import http from '@/utils/http'
import { ShowType } from '@/enums/constEnums'
import {
  OffsiteSourceInterfaceRes,
  InStationSourceInterfaceRes,
  UidSourceInterfaceRes,
} from '@/api/sourceAnalysis/types'
/**
 * @description 获取来源分析-站外来源数据
 * @param searchParams
 */
export function getOffsiteSource(searchParams: {
  type: ShowType // 汇总0 PC端 1 移动端 2
  dateRange: string[] // 日期范围
}) {
  return http.post<OffsiteSourceInterfaceRes[]>(
    `/admin/sourceAnalysis/offsiteSource/info`,
    searchParams,
  )
}
/**
 * @description 获取来源分析-站内来源数据
 * @param searchParams
 */
export function getInStationSource(searchParams: {
  type: ShowType // 汇总0 PC端 1 移动端 2
  dateRange: string[] // 日期范围
}) {
  return http.post<InStationSourceInterfaceRes[]>(
    `/admin/sourceAnalysis/inStationSource/info`,
    searchParams,
  )
}
/**
 * @description 获取来源分析-UID来源数据
 * @param searchParams
 */
export function getUidSource(searchParams: {
  type: ShowType // 汇总0 PC端 1 移动端 2
  dateRange: string[] // 日期范围
}) {
  return http.post<UidSourceInterfaceRes[]>(
    `/admin/sourceAnalysis/uidSource/info`,
    searchParams,
  )
}
